home *** CD-ROM | disk | FTP | other *** search
- Date: Sat, 9 Jul 1994 23:40:03 -0400 (EDT)
- From: Timothy Miller <millert@undergrad.csee.usf.edu>
- Subject: Re: Gem Listing (fwd)
- To: gem-list@world.std.com
- In-Reply-To: <memo.600496@cix.compulink.co.uk>
- Message-Id: <Pine.3.87.9407092303.B3776-0100000@grad>
- Mime-Version: 1.0
- Precedence: bulk
-
- Goemon:
-
- ]> Who said it was difficult? We're not talking about difficulty. We were
- ]> talking about system overhead and wasted time.
- ]>
- ]> What's difficult is making a larger-than-1-pixel rectangle so that your
- ]> app doesn't have to be called for every mouse movement, and system time
- ]> doesn't have to be wasted.
- ]The only time this will happen is when the application is topped. If it's
- ]not topped, then a click in one of the windows will send an event to
- ]the app to "wake up".
- ]
- ]Even so, the overhead is *miniscule*. I've got it in my head to write a
- ]benchmark program to compare overheads of different methods, and put this
- ]argument to rest permanently.
-
- You're missing the point. If the OS has a large rectangle to compare
- against, and the mouse moves, it only has to check a few numbers. ONLY
- when the OS finds the pointer entering or leaving the rectangle does it
- have to go back to your program.
-
- If you use a 1-pixel rectangle, then EVERY mouse movement goes back to
- your program, and your program has to do an objc_find, EVERY TIME.
-
- In a single-tasking environment, it doesn't matter which you do, but in a
- multitasking environment, the OS having to go back to your program for
- EVERY mouse movement creates a tremendous amount of overhead that is very
- wasteful. Compare running your code for every 1 mouse movement to
- running your code for every 20 mouse movements.
-
- The OS code has to run every time, but your code doesn't because it only
- needs to know about certain entries/exist, and to call your EXTRA CODE
- repeatedly to do nothing but realize that it needn't do anything is wasteful.
-
-
-
-